<template>
  <div class="z-card-switch flex">
    <div class="z-card-switch__left flex flex-col">

      <ZTooltip :content="label"
                :line="1"
                v-if="label">
        <span class="z-card-switch__left-label">{{label}}</span>
      </ZTooltip>
      <ZTooltip :content="desc"
                :line="3"
                v-if="desc">
        <span class="z-card-switch__left-desc">{{desc}}</span>
      </ZTooltip>
    </div>
    <div class="z-card-switch__right">
      <el-switch v-bind="$attrs"
                 v-on="$listeners"></el-switch>
    </div>
  </div>
</template>

<script>
import ZTooltip from '@/components/storybook/z-tooltip'

export default {
  name: 'ZCardSwitch',
  components: {
    ZTooltip
  },
  props: {
    label: String,
    desc: String
  }

}
</script>

<style lang="scss" scoped>
.z-card-switch {
  width: 100%;
  height: 115px;
  border-radius: 5px;
  padding: 12px 11px;
  border: 1px solid #dcdfe6;
  &__left {
    padding-right: 32px;
    &-label {
      font-size: 14px;
      color: #404040;
      font-weight: 600;
      line-height: 27px;
      color: rgba(0, 0, 0, 0.9);
    }
    &-desc {
      font-size: 14px;
      line-height: 21px;
      color: rgba(0, 0, 0, 0.61);
    }
  }
}
</style>
